package net.myspring.middle.domain;

import net.myspring.common.domain.DataEntity;
import net.myspring.common.mybatis.provider.annotation.Entity;
import net.myspring.common.mybatis.provider.annotation.Table;

/**
 * Created by liuj on 16/7/10.
 */
@Entity
@Table(name="sys_permission")
public class Permission extends DataEntity<Permission> {
    private Menu menu;
    private String name;
    private String code;

    private String menuId;

    public String getMenuId() {
        if (menuId == null && menu != null) {
            menuId = menu.getId();
        }
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public Menu getMenu() {
        return menu;
    }

    public void setMenu(Menu menu) {
        this.menu = menu;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}